#!/run/current-system/profile/bin/guile \
-e main -s
!#

(define %display
  (and=> (getenv "DISPLAY")
         (lambda (display)
           display)))

(define (main args)
  (when %display
    (display "Disable DPMS and screensaver.\n" (current-error-port))
    (system* "xset" "s" "off")
    (system* "xset" "-dpms"))
  (apply system* (append '("looking-glass-client"
                           "spice:enable" "no"
                           "wayland:warpSupport" "no"
                           "input:grabKeyboard" "no"
                           "win:dontUpscale" "yes")
                         (cdr args))))
